namespace = perf_patch

character_event = {
    id = perf_patch.1
    hide_window = yes
    is_triggered_only = yes

    trigger = {
        NOT = { has_character_flag = ek2_story_char }
        NOT = { has_character_flag = ek2_unique_hero }
    }

    immediate = {
        performance_courtier_pruning = yes
        performance_throttle_peacetime_ai = yes
    }
}


Suggested Fixes:
Okay, here's a breakdown of how to fix the identified issues in your Crusader Kings 3 mod:

**I. Syntax Errors in Event Files (performance_patch_events.txt):**

   The provided code snippet has no immediately obvious syntax errors, assuming all CK3 event scripting conventions are followed.  However, event files are notoriously prone to errors.  Here's a general approach to debugging them:

   1.  **File Location:**  `CK3 Performance Mod and Elder Kings 2 Compatch/events/performance_patch_events.txt`

   2.  **Common Syntax Issues and Corrections:**

       *   **Missing or Mismatched Braces `{}`:**  CK3 scripting relies heavily on proper nesting of braces.  Every opening brace must have a corresponding closing brace.  This is the *most* common error.
           *   *How to Fix:* Carefully examine your code, especially around complex conditions (triggers, immediate effects). Use a text editor with brace-matching capabilities (like VS Code with a CK3 syntax highlighting extension) to quickly identify mismatches. The error message from the game launcher can give you the line number where the syntax error is.

       *   **Incorrect Use of `else` Clauses:**  If you're using `else` within an `if` block, ensure it's correctly placed.
           *   *How to Fix:* CK3 syntax for `if` and `else` looks like this:
            ```
            if = {
                limit = { some_trigger = yes }
                effect = { ... }
            }
            else = {
                effect = { ... }
            }
            ```

       *   **Invalid Identifiers/Keywords:**  Typos in event IDs, trigger names, effect names, or other keywords will cause errors.  CK3 is *very* strict.
           *   *How to Fix:* Double-check all identifiers against the CK3 scripting documentation or examples from the base game files. Pay close attention to capitalization.

       *   **Missing or Incorrect Scope Changes:** When working with characters, titles, provinces, etc., you often need to change scope using keywords like `character`, `holder`, `province`, etc. If these scope changes are missing or used incorrectly, triggers or effects may not function as intended.
           *   *How to Fix:* Examine the scope requirements of the triggers and effects you are using. Use the `FROM`, `PREV`, `ROOT`, and other scope keywords to properly navigate relationships between objects in the game.

       *   **Missing Trigger/Immediate Block:** An event needs a `trigger = { ... }` block to define when the event can fire and an `immediate = { ... }` block for instant effects.

   3. **Debugging Tips:**
         * Make incremental changes and test.  Add a small piece of code, and then launch the game to see if it works. If it does, add another small piece. This makes it much easier to isolate the source of an error.
         * Comment out sections of code.  If you have a large event file, comment out half of it (using `#`) and see if the error goes away. If it does, the error is in the commented-out section. Repeat this process to narrow down the problematic code.
         * Use the CK3 error log. The `game.log` file (usually in `Documents/Paradox Interactive/Crusader Kings III/logs`) often contains helpful error messages that can pinpoint the source of syntax problems. Read them carefully!

**II. Missing Localization Entries:**

   Your mod likely introduces new events, traits, or other elements that require localized text (descriptions, names, etc.).  Without localization, these elements will appear in-game using their internal IDs, which is not user-friendly.

   1.  **File Location:** Create `.yml` files within the following directory structure:
       *   `CK3 Performance Mod and Elder Kings 2 Compatch/localization/<language code>/`
       *   `<language code>` represents the language you're localizing for (e.g., `english`, `french`, `german`, `spanish`). You need a separate folder for each language. Create the directories if they don't exist.
          * For a compatibility patch, ensure to include *all* possible EK2 entries that you are modifying or referencing. 

   2.  **File Format (Example `english/example_l_english.yml`):**
       ```yml
       l_english:
        perf_patch.1.title: 